<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Cajax</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<style type="text/css">
			textarea {
				width:100%;
				height:400px;
			}
		</style>
		<script type="text/javascript" src="js/cajax.js"></script>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery.cajax.js"></script>
	</head>
	<body>
		<script type="text/javascript">
			Cajax.init('flash/bin/cajax.swf', document.body, true);
			
			var URL = 'http://www.vostu.com/en/wp-content/themes/vostu_en/style.css';
			
			function testVanilla() {
				var cajax = new Cajax();
				cajax.onreadystatechange = function(){
					if (this.readyState === 4) {
						var text = document.createElement('textarea');
						text.value = 'With Native:\n'+URL+'\n\n' + this.responseText;
						document.body.appendChild(text);
					}
				};
				cajax.open('get', URL, true);
				cajax.send();
			}
			
			function testjQuery() {
				$.get(URL, function(res){
					$('<textarea></textarea>').val('With jQuery:\n'+URL+'\n\n'+res).appendTo('body');
				});
			}
			
			testVanilla();
			testjQuery();
			
		</script>
	</body>
</html>
